//
//  CarInfo.swift
//  JiaoZiTaxi
//
//  Created by Hu Gang on 2022/10/30.
//

import Foundation

enum EnumCarStatus {
   case idle
   case busy
}

struct CarInfo: Identifiable {
   var id: String

   let carNo: String
   let driverMobile: String
   var status: EnumCarStatus = .idle
   var direction: Double = 0 // 0 - 360
   var speed: Double = 0

   init(id: String) {
      self.driverMobile = ""
      self.carNo = ""
      self.id = id
      self.direction = 0.0
      self.speed = 0.0
   }

   init(id: String, carNo: String, driverMobile: String, direction: Double, speed: Double, status: EnumCarStatus) {
      self.driverMobile = driverMobile
      self.carNo = carNo
      self.status = status
      self.id = id
      self.direction = direction
      self.speed = speed
   }
}
